-- GENERATED SPELL FOR [Ellrys Duskhallow] --


function spell0_24558(pUnit, Event) --@Curse of Agony,n/a--
pUnit:FullCastSpellOnTarget(14875,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_24558', 30000, 1)
end

function spell1_24558(pUnit, Event) --@Curse of Agony,n/a--
pUnit:FullCastSpellOnTarget(46190,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_24558', 30000, 1)
end

function spell2_24558(pUnit, Event) --@Death Coil,n/a--
pUnit:FullCastSpellOnTarget(44142,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_24558', 3334, 1)
end

function spell3_24558(pUnit, Event) --@Drink Healing Potion,Self--
pUnit:FullCastSpellOnTarget(15503,pUnit)
pUnit:RegisterEvent('Sorts_24558', 662, 1)
end

function spell4_24558(pUnit, Event) --@Fear,n/a--
pUnit:FullCastSpellOnTarget(38595,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_24558', 5500, 1)
end

function spell5_24558(pUnit, Event) --@Immolate,n/a--
pUnit:FullCastSpellOnTarget(44267,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_24558', 17000, 1)
end

function spell6_24558(pUnit, Event) --@Immolate,n/a--
pUnit:FullCastSpellOnTarget(46191,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_24558', 17000, 1)
end

function spell7_24558(pUnit, Event) --@Medallion of Immunity,Self--
pUnit:FullCastSpellOnTarget(46227,pUnit)
pUnit:RegisterEvent('Sorts_24558', 296, 1)
end

function spell8_24558(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(12471,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_24558', 3000, 1)
end

function spell9_24558(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(15232,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_24558', 3000, 1)
end

function spell10_24558(pUnit, Event) --@Summon Imp,Self--
pUnit:FullCastSpellOnTarget(44163,pUnit)
pUnit:RegisterEvent('Sorts_24558', 5000, 1)
end

function Sorts_24558(pUnit, Event)
local choix_sorts_24558 = math.random(0, 10)
if choix_sorts_24558 == 0 then
pUnit:RegisterEvent('spell0_24558', 1, 1)
end
if choix_sorts_24558 == 1 then
pUnit:RegisterEvent('spell1_24558', 1, 1)
end
if choix_sorts_24558 == 2 then
pUnit:RegisterEvent('spell2_24558', 1, 1)
end
if choix_sorts_24558 == 3 then
pUnit:RegisterEvent('spell3_24558', 1, 1)
end
if choix_sorts_24558 == 4 then
pUnit:RegisterEvent('spell4_24558', 1, 1)
end
if choix_sorts_24558 == 5 then
pUnit:RegisterEvent('spell5_24558', 1, 1)
end
if choix_sorts_24558 == 6 then
pUnit:RegisterEvent('spell6_24558', 1, 1)
end
if choix_sorts_24558 == 7 then
pUnit:RegisterEvent('spell7_24558', 1, 1)
end
if choix_sorts_24558 == 8 then
pUnit:RegisterEvent('spell8_24558', 1, 1)
end
if choix_sorts_24558 == 9 then
pUnit:RegisterEvent('spell9_24558', 1, 1)
end
if choix_sorts_24558 == 10 then
pUnit:RegisterEvent('spell10_24558', 1, 1)
end
end

function mob24558_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_24558', math.random(1500, 3000), 1)
end

function mob24558_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob24558_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob24558_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(24558, 1, 'mob24558_Action')
RegisterUnitEvent(24558, 2, 'mob24558_Leave')
RegisterUnitEvent(24558, 3, 'mob24558_Kill')
RegisterUnitEvent(24558, 4, 'mob24558_Die')
